
/**
 * 语音分享H5页面
 */
define([ "app", "jquery", "md5", "ecb", 
        "services/UserService",
		"resources/UserResource", 
		'directives/AudioPlayer',
		"resources/VoicePlayResource"], function(app) {

	var deps = [ "$scope", "$state", "$modal","$window","$location", "$stateParams","UserService","UserResource","VoicePlayResource"];

	function controller($scope, $state, $modal,$window,$location, $stateParams,UserService,UserResource,VoicePlayResource) {
		
		$scope.showVoice=false;
		var path=$location.$$url;
		var host =$location.$$host;
		var port =$location.$$port;
		var fileId =path.substring(path.indexOf('?')+1);
		var obg =document.getElementById("voiceId");
		obg.src="http://"+host+":"+port+"/yokivoice/restful/upload/showPic/"+fileId;
		//$scope.attachsId=fileId;
		// 屏幕宽度
		//var clientWidth = $window.document.documentElement.clientWidth;
		// 计算缩放比例
		//var scale =clientWidth/640;
		VoicePlayResource.queryVoiceById(fileId).success(function(data){
			$scope.voiceName=data.voiceName;
			$scope.userName=data.nickName;
			$scope.shareDate=data.shareDate;
			$scope.cityName=data.cityName;
			
        });
		
	}
	controller.$inject = deps;
	return app.lazy.controller("VoicePlayController", controller);
});
